import { renderTableHeader } from "@/utils";

export const tabelecolum = [
  {
    props: "articleTitle", //字段
    align: "center", //对齐方式
    minWidth: 300, //宽度
    fixed: "left",
    showInSerach:true, //在过滤查询显示
    // hideInTable:true,//在表格隐藏该列
    valueType:"input",//表单类型
    defaultValue:111,//默认值
    searTitle:'普通输入框',//lable
    // 自定义属性
    prop:{
      style:{
        width:'220px'
      },
      rules:[],
      placeholder:"请输入",
    },
    render: (h, { column }) => {
      return renderTableHeader(h, { column }, "带提示得表头文案");
    },
    label: () => {
      return "标题";
    }
  },
  {
    props: "articleTypeId",
    label: () => {
      return "文章类型id";
    },
    minWidth: 100,
    showInSerach:true,
    align: "left" ,
    valueType:"select",
    searTitle:'带固定数据源下拉',
    defaultValue:1,//默认值
    prop:{
      style:{
        width:'320px'
      },
      rules:[],
      placeholder:"请输入",
    },
    sourceData:[
      {
        label:'类型一',
        value:1
      },
      {
        label:'类型二',
        value:2
      }
    ]
  },
  {
    props: "articleMarket",
    minWidth: 200,
    label: () => {
      return "市场类型";
    },
    showInSerach:true,
    valueType:"select",
    searTitle:'通过接口数据源下拉',
    sourceData:()=>{
      return this.$getTypeList().then(res=>{
        console.log(res)
      })
      // this.$api.then(res=>{
      
      // })
      
    }
  },
  {
    props: "createDate",
    minWidth: 200,
    sortable: true,
    label: () => {
      return "时间";
    }
  },
  {
    props: "inventedReadNum",
    minWidth: 100,
    sortable: true,
    label: () => {
      return "阅读数";
    }
  },
  {
    props: "followstatus",
    minWidth: 100,
    sortable: true,
    label: () => {
      return "粉丝数";
    }
  },
  {
    props: "commentCount",
    minWidth: 100,
    sortable: true,
    label: () => {
      return "评论数";
    }
  },
  {
    props: "abstracts",
    minWidth: 200,
    width:300,
    showTool:true,
    label: () => {
      return "描述";
    }
  },

  {
    props: "spcolumnName",
    minWidth: 200,
    label: () => {
      return "专栏名";
    }
  },
  {
    props: "spcolumnId",
    minWidth: 200,
    label: () => {
      return "专栏id";
    }
  },
  {
    props: "updateDate",
    minWidth: 200,
    label: () => {
      return "更新时间";
    }
  },
 
  {
    props: "headUrl",
    fixed: "right",
    html: true,
    compName: "tableIMg",
    width:300,
    label: () => {
      return "头像-自定义组件展示";
    }
  }
];
